{% extends "base.html" %}

{% block content %}
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title mb-0">新增安全检查</h4>
                </div>
                <div class="card-body">
                    <form method="POST">
                        <div class="row mb-3">
                            <div class="col-md-6">
                                <label class="form-label">产品名称</label>
                                <input type="text" class="form-control" name="product_name" required>
                            </div>
                            <div class="col-md-6">
                                <label class="form-label">批次号</label>
                                <input type="text" class="form-control" name="batch_number" required>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <div class="col-md-6">
                                <label class="form-label">检查类型</label>
                                <select class="form-select" name="inspection_type" required>
                                    <option value="routine">常规检查</option>
                                    <option value="special">专项检查</option>
                                    <option value="followup">跟进检查</option>
                                </select>
                            </div>
                            <div class="col-md-6">
                                <label class="form-label">检查人</label>
                                <input type="text" class="form-control" name="inspector" required>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <div class="col-md-6">
                                <label class="form-label">检查时间</label>
                                <input type="datetime-local" class="form-control" name="inspection_date" required>
                            </div>
                            <div class="col-md-6">
                                <label class="form-label">检查结果</label>
                                <select class="form-select" name="result" required>
                                    <option value="pending">待定</option>
                                    <option value="passed">通过</option>
                                    <option value="failed">不通过</option>
                                </select>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <div class="col-md-6">
                                <label class="form-label">温度 (°C)</label>
                                <input type="number" class="form-control" name="temperature" step="0.1">
                            </div>
                            <div class="col-md-6">
                                <label class="form-label">湿度 (%)</label>
                                <input type="number" class="form-control" name="humidity" step="0.1">
                            </div>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">发现问题</label>
                            <textarea class="form-control" name="issues_found" rows="3"></textarea>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">改进建议</label>
                            <textarea class="form-control" name="recommendations" rows="3"></textarea>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">下次检查时间</label>
                            <input type="date" class="form-control" name="next_inspection_date">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">备注</label>
                            <textarea class="form-control" name="notes" rows="3"></textarea>
                        </div>
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary">提交</button>
                            <a href="{{ url_for('safety.inspection_list') }}" class="btn btn-secondary">返回列表</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 